Unit UretimMakinaAcilimi;

Interface

Uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, Grids, Wwdbigrd, Wwdbgrid;

Type
  TUretimMakinaAcilimiF = Class(TForm)
    MakinaAcilimi: TADOQuery;
    MakinaAcilimiS: TDataSource;
    wwDBGrid1: TwwDBGrid;
    Procedure FormClose(Sender: TObject; Var Action: TCloseAction);
    Procedure FormShow(Sender: TObject);
    Procedure FormKeyPress(Sender: TObject; Var Key: Char);
  Private
    { Private declarations }
  Public
    MakinaNo: String;
    { Public declarations }
  End;

Var
  UretimMakinaAcilimiF: TUretimMakinaAcilimiF;

Implementation

Uses data;

{$R *.dfm}

Procedure TUretimMakinaAcilimiF.FormClose(Sender: TObject;
  Var Action: TCloseAction);
Begin
  MakinaAcilimi.Close;
  MakinaAcilimi := Nil;

  Action := cafree;
  UretimMakinaAcilimiF := Nil;
End;

Procedure TUretimMakinaAcilimiF.FormShow(Sender: TObject);
Begin
  MakinaAcilimi.Close;
  MakinaAcilimi.SQL.text :=
    'select serinos,stokkodu=(select stokkodu from stok where stok.stokkod=fatharhar.stokkod),cinsi=(select cinsi from stok where stok.stokkod=fatharhar.stokkod) ';
  MakinaAcilimi.SQL.add('from fatharhar where makinano=' + #39 + MakinaNo +
    #39);
  MakinaAcilimi.Open;

  Caption := Caption + ' [' + MakinaNo + ']'

End;

Procedure TUretimMakinaAcilimiF.FormKeyPress(Sender: TObject;
  Var Key: Char);
Begin
  If key = #27 Then
    close;
End;

End.
